{{response.files.append(URL(r=request,c='static',f='jquery.dataTables.min.js'))}}
{{response.files.append(URL(r=request,c='static',f='demo_table.css'))}}
{{extend 'layout.html'}}

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
    jQuery('.smarttable').dataTable();
} );
</script>

<h1>{{=T('Pledges by Segment')}}</h1>

<button onclick="document.location='{{=URL(r=request,f='create_pledge',args=segment_id)}}'">{{=T("Create a New Pledge")}}</button>

<table class="smarttable">
<thead>
    <th>{{=T('Amount')}}</th>
    <th>{{=T('Name')}}</th>
    <th>{{=T('Time Created')}}</th>
    <th>{{=T('Actions')}}</th>
</thead>
<tbody>
{{for pledge in pledges:}}
<tr>
    <td>{{=pledge.amount}}</td>    
    <td>{{=pledge.name}}</td>    
    <td>{{=pledge.created_on}}</td>
    <td>
    <a href="{{=URL(r=request,f='edit_pledge',args=pledge.id)}}">{{=T('Edit')}}</a>
    </td>
</tr>
{{pass}}
</tbody>
</table>
